import http from '../../utils/http.js'

/* 发送短信 */
export function getAcitivityInfo(){
	return new Promise((resolve,reject)=>{
	    var params={
		   url:'/v1/activity/list',
		   method:'GET',
		   data:{},
		   callBack:(res)=>{
			if(res.code==0){
			 resolve(res)
			}
			else{
			 reject(res.msg)
			}
		}
	  }
	  http.request(params)
	})
}

export function getPopUpInfo(){
	return new Promise((resolve,reject)=>{
	    var params={
		   url:'/v1/activity/list',
		   method:'GET',
		   data:{
			   source: 1
		   },
		   callBack:(res)=>{
			if(res.code==0){
			 resolve(res)
			}
			else{
			 reject(res.msg)
			}
		}
	  }
	  http.request(params)
	})
}

export function getMessageInfo(type,page,size=10){
	return new Promise((resolve,reject)=>{
	    var params={
		   url:'/v1/app/member/get/message',
		   method:'GET',
		   data:{
			  type: type,
			  current: page,
			  size: size
		   },
		   callBack:(res)=>{
			if(res.code==0){
			 resolve(res)
			}
			else{
			 reject(res.msg)
			}
		}
	  }
	  http.request(params)
	})
}